#!/usr/bin/make -f
# debian/rules that uses debhelper >= 7.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# This has to be exported to make some magic below work.
export DH_OPTIONS

%:
	dh  $@

.PHONY: override_dh_auto_configure
override_dh_auto_configure:
	dh_auto_configure -- --enable-python2 --enable-python3 CFLAGS="-g"

.PHONY: override_dh_auto_test
override_dh_auto_test:

.PHONY: override_dh_install
override_dh_install:
	# Create the libregf package.
	dh_install "debian/tmp/usr/lib/lib*.so.*.*.*" -p libregf
	# Create the libregf-dev package.
	dh_install "debian/tmp/usr/include/*.h" -p libregf-dev
	dh_install "debian/tmp/usr/include/lib*/*.h" -p libregf-dev
	dh_install "debian/tmp/usr/lib/*.a" -p libregf-dev
	dh_install "debian/tmp/usr/lib/*.la" -p libregf-dev
	dh_install "debian/tmp/usr/lib/*.so" -p libregf-dev
	dh_install "debian/tmp/usr/lib/pkgconfig/*" -p libregf-dev
	dh_install "debian/tmp/usr/share/man/man3/*" -p libregf-dev
	# Create the libregf-tools package.
	dh_install "debian/tmp/usr/bin/*" -p libregf-tools
	dh_install "debian/tmp/usr/share/man/man1/*" -p libregf-tools
	# Create the libregf-python package.
	dh_install -X"*_d.so" "debian/tmp/usr/lib/python2*/*" -p libregf-python
	# Create the libregf-python3 package.
	dh_install -X"*_d.so" "debian/tmp/usr/lib/python3*/*" -p libregf-python3
	# The libregf-dbg, libregf-python-dbg and libregf-python3-dbg packages
	# are created by dh_strip.
	dh_install

.PHONY: override_dh_installmenu
override_dh_installmenu:

.PHONY: override_dh_installmime
override_dh_installmime:

.PHONY: override_dh_installmodules
override_dh_installmodules:

.PHONY: override_dh_installlogcheck
override_dh_installlogcheck:

.PHONY: override_dh_installlogrotate
override_dh_installlogrotate:

.PHONY: override_dh_installpam
override_dh_installpam:

.PHONY: override_dh_installppp
override_dh_installppp:

.PHONY: override_dh_installudev
override_dh_installudev:

.PHONY: override_dh_installwm
override_dh_installwm:

.PHONY: override_dh_installxfonts
override_dh_installxfonts:

.PHONY: override_dh_gconf
override_dh_gconf:

.PHONY: override_dh_icons
override_dh_icons:

.PHONY: override_dh_perl
override_dh_perl:

.PHONY: override_dh_pysupport
override_dh_pysupport:

.PHONY: override_dh_strip
override_dh_strip:
ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
	dh_strip -plibregf --dbg-package=libregf-dbg
	dh_strip -plibregf-python --dbg-package=libregf-python-dbg
	dh_strip -plibregf-python3 --dbg-package=libregf-python3-dbg
endif

.PHONY: override_dh_shlibdeps
override_dh_shlibdeps:
	dh_shlibdeps -Llibregf -l${CURDIR}/debian/tmp/usr/lib

.PHONY: override_dh_makeshlibs
override_dh_makeshlibs:
	dh_makeshlibs -Xlibregf-dev

